{% extends 'mac_basic.html' %}


{% block title %}
    创建部门
{% endblock %}


{% block css %}
    <style>
        .form {
            width: 500px;
            margin-top: 51px ;
            margin-left: 150px;
        }
        .form-group {
                margin-bottom: 25px;
        }
        .error_span {
            position: absolute;
            color: red;
        }
        #department_title {
            border-bottom: 3px solid #8B8989;
            padding-left: 200px;
        }
        #id_a {
            margin-top: 20px;
            margin-left: 20px;
        }
    </style>
{% endblock %}


{% block content %}
    <div id="id_a"><a class="btn btn-default" href="{% url 'department_list' %}" role="button">返回</a></div>

    <div id="department_title">
        {% if did %}
            <h3>修改<small> 部门</small></h3>
        {% else %}
            <h3>新增<small> 部门</small></h3>
        {% endif %}
    </div>
    <div class="form">

        <form method="post" class="form-horizontal" novalidate>
            {% for obj in departments_form %}
                <div class="form-group">
                    <label for="mac_id" class="col-sm-3 control-label">{{ obj.label_tag }}</label>
                    <div class="col-sm-9">
                        {{ obj }}
                        <span class="error_span" id="error_mac">{{ obj.errors }}</span>
                    </div>
                </div>
            {% endfor %}
            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-3">
                    <input  class="form-control btn btn-info" type="submit" value="确定">
                </div>
            </div>
        </form>
    </div>
{% endblock %}


{% block js %}

{% endblock %}
